package exceptionHomework;

public class ThrowDemo2 {
    public static void main(String[] args) {
        Student ww=new Student();
        try {
            ww.setAge(1000);
            System.out.println("此人年龄为："+ww.getAge()+"岁");
        }catch (Exception e){
            System.out.println("年龄不合法");
        }
    }
}
